package it.ap.sa.acqua.dao.model;
// Generated 23-ago-2017 17.05.29 by Hibernate Tools 4.3.1.Final

import java.time.LocalDate;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.OneToOne;
import javax.persistence.Table;

import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;
import org.hibernate.annotations.DynamicUpdate;
import org.hibernate.annotations.GenericGenerator;
import org.hibernate.annotations.Parameter;

/**
 * TUser generated by hbm2java
 */
@DynamicUpdate
@Cache(region = "it.eng.db.TUser", usage = CacheConcurrencyStrategy.READ_WRITE)
@Entity
@Table(name = "t_user", schema = "public")
public class TUser implements java.io.Serializable {

	private Long id;

	private String password;

	private String ssoId;

	private String firstName;

	private String lastName;

	private String email;

	private String urlImage;

	private LocalDate dateBirth;

	private TUserProfile TUserProfile;

	public TUser() {
	}

	public TUser(String password, String ssoId, String firstName, String lastName, String email, String urlImage,
			LocalDate dateBirth, TUserProfile TUserProfile) {
		this.password = password;
		this.ssoId = ssoId;
		this.firstName = firstName;
		this.lastName = lastName;
		this.email = email;
		this.urlImage = urlImage;
		this.dateBirth = dateBirth;
		this.TUserProfile = TUserProfile;
	}

	@GenericGenerator(name = "generator", strategy = "org.hibernate.id.SequenceGenerator", parameters = @Parameter(name = "sequence", value = "sequence_id"))
	@Id
	@GeneratedValue(generator = "generator")

	@Column(name = "id", unique = true, nullable = false)
	public Long getId() {
		return this.id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	@Column(name = "password")
	public String getPassword() {
		return this.password;
	}

	public void setPassword(String password) {
		this.password = password;
	}

	@Column(name = "sso_id")
	public String getSsoId() {
		return this.ssoId;
	}

	public void setSsoId(String ssoId) {
		this.ssoId = ssoId;
	}

	@Column(name = "first_name")
	public String getFirstName() {
		return this.firstName;
	}

	public void setFirstName(String firstName) {
		this.firstName = firstName;
	}

	@Column(name = "last_name")
	public String getLastName() {
		return this.lastName;
	}

	public void setLastName(String lastName) {
		this.lastName = lastName;
	}

	@Column(name = "email")
	public String getEmail() {
		return this.email;
	}

	public void setEmail(String email) {
		this.email = email;
	}

	@Column(name = "url_image")
	public String getUrlImage() {
		return this.urlImage;
	}

	public void setUrlImage(String urlImage) {
		this.urlImage = urlImage;
	}

	@Column(name = "date_birth", length = 13)
	public LocalDate getDateBirth() {
		return this.dateBirth;
	}

	public void setDateBirth(LocalDate dateBirth) {
		this.dateBirth = dateBirth;
	}

	@OneToOne(fetch = FetchType.LAZY, mappedBy = "TUser")
	public TUserProfile getTUserProfile() {
		return this.TUserProfile;
	}

	public void setTUserProfile(TUserProfile TUserProfile) {
		this.TUserProfile = TUserProfile;
	}

	/**
	 * toString
	 * @return String
	 */
	public String toString() {
		StringBuffer buffer = new StringBuffer();

		buffer.append(getClass().getName()).append("@").append(Integer.toHexString(hashCode())).append(" [");
		buffer.append("id").append("='").append(getId()).append("' ");
		buffer.append("password").append("='").append(getPassword()).append("' ");
		buffer.append("ssoId").append("='").append(getSsoId()).append("' ");
		buffer.append("firstName").append("='").append(getFirstName()).append("' ");
		buffer.append("lastName").append("='").append(getLastName()).append("' ");
		buffer.append("email").append("='").append(getEmail()).append("' ");
		buffer.append("urlImage").append("='").append(getUrlImage()).append("' ");
		buffer.append("dateBirth").append("='").append(getDateBirth()).append("' ");
		buffer.append("TUserProfile").append("='").append(getTUserProfile()).append("' ");
		buffer.append("]");

		return buffer.toString();
	}

}
